import ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { ConfigProvider } from 'antd';
// 由于 antd 组件的默认文案是英文，所以需要修改为中文
import zhCN from 'antd/es/locale/zh_CN';

import { BrowserRouter } from 'react-router-dom'

import { Provider } from 'react-redux'
import store from './store'

import './index.css';

const root = ReactDOM.createRoot(
  // document.getElementById('root') as HTMLElement // 类型断言
  document.getElementById('root') as HTMLDivElement // 类型断言
);
root.render(
  <ConfigProvider locale={zhCN}>
    <Provider store = { store }>
      <BrowserRouter>
        <App />
      </BrowserRouter>
    </Provider>
  </ConfigProvider>
);

// react 18 版本以前
/**
 * import ReactDOM from 'react-dom'
 * ReactDOM.render(<App />, document.getElementById('root') as HTMLDivElement )
 */

reportWebVitals();
